<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:f="livcos.org/ns/xslt/function"
  xmlns:v="livcos.org/ns/view"
  exclude-result-prefixes="xs f v">
	
	<!-- unrecognized elements -->
	
	<xsl:import href="../base.xsl"/>
	<xsl:import href="../../style/meta_content.xsl"/>
	
	<xsl:template match="/*">
		<html id="{$callerObjId}">
			<v:head>
				<v:title>{<xsl:value-of select="namespace-uri()"/>}<xsl:value-of select="local-name()"/></v:title>
				<v:context>Unrecognized Root Element</v:context>
			</v:head>
			<body id="{f:object-id(.)}">
				<v:style ref="{resolve-uri('../../css/webXml.css')}"/>
				<xsl:apply-imports/>
			</body>
		</html>
	</xsl:template>
	
	<xsl:template match="*">
		<v:style ref="{resolve-uri('../../css/webXml.css')}"/>
		<xsl:apply-imports/>
	</xsl:template>
	
	<xsl:template name="printNamespaceDecls">
		<xsl:for-each select="namespace::*[local-name(.) != 'xml']">
			<xsl:variable name="prefix" select="local-name(.)"/>
			<xsl:variable name="nsUri" select="."/>
			<xsl:if test="not(../ancestor::*/namespace::*[(local-name(.) = $prefix) and (. = $nsUri)])">
				<xsl:call-template name="printNS">
					<xsl:with-param name="prefix" select="$prefix"/>
					<xsl:with-param name="nsUri" select="$nsUri"/>
				</xsl:call-template>
			</xsl:if>
		</xsl:for-each>
	</xsl:template>
	
	<xsl:template match="*" mode="content">
		<xsl:apply-templates select="node()" mode="default_content"/>
	</xsl:template>
	
	<xsl:template match="*" mode="default_content" priority="2">
		<xsl:apply-templates select="."/>
	</xsl:template>
	
	<xsl:template match="node()" mode="default_content">
		<xsl:apply-imports/>
	</xsl:template>
	
	<xsl:template match="text()">
		<xsl:value-of select="."/>
	</xsl:template>
	
</xsl:stylesheet>
